1. Field of the Invention
This invention relates to a method and an apparatus for variable length encoding. More particularly, it relates to a method and an apparatus for variable length encoding in which plural signals are mixed on the time base to carry out encoding by utilizing a so-called run-length coding.
2. Description of the Prior Art
In a digital video tape recorder (VTR), for example, since data to be recorded is voluminous, it is critical to decrease the data volume by compression encoding. One of a variety of high efficiency encoding techniques for data compression is variable length encoding taking advantage of a run length. The variable length encoding, which may be used singly, may also be used in combination with other encoding systems. For example, there is known a high efficiency encoding in which coefficient data produced by transform encoding is encoded by variable length encoding.
Meanwhile, if plural independent signals, such as transform coded data signals of luminance signals and chroma signals of color video signals, are mixed on the time base and processed by variable length encoding utilizing run length, the encoded results do not strictly maintain the relative position (sequence) on the time base, so that separate code tables cannot be afforded to these encoding results.
For the same reason, if a package in which the respective signal components are arrayed in the order of the increasing degree of importance is arranged into encoding blocks, the degree of importance of the components lost on error occurrence in arbitrary points of the package can not be rendered uniform.
Besides, if the contents of the package are divided into groups by signal and run distribution and separate code tables are applied for enhancing the efficiency, it is necessary to divide the groups by e.g. predetermined codes such as end-of-group codes. Therefore it becomes necessary to output the prescribed codes such as end-of-groups as separate codes even if the encoding block comes to an end in the intermediate group or to provide the predetermined codes such as end-of-groups as entirely unique codes.